﻿CREATE PROCEDURE [ServiceEngine].[GetOperationVersion]
	@ID uniqueidentifier
AS
BEGIN
	SET NOCOUNT ON;

	SELECT	OV.OperationVersionID as ID, OV.OperationID as OperationID, N.[EntityName] as [Name], OV.VersionMajor, OV.VersionMinor, OV.VersionBuild, OV.VersionQFE,			
			OV.AutoResponse, OV.IsPublic, OV.IsActive, OV.IsTestable, OV.RequestTransformXSLT, OV.ResponseTransformXSLT, R.Moniker, OV.Description, OV.ResourceID, OV.PolicyID				
	FROM	[ServiceEngine].OperationVersions OV
	JOIN	[ServiceEngine].Operations O ON OV.OperationID = O.OperationID
	JOIN	[ServiceEngine].[Names] N ON N.EntityID = O.OperationID
	LEFT OUTER JOIN	[ServiceEngine].[Resources] R ON R.ResourceID = OV.ResourceID
	WHERE	OV.OperationVersionID = @ID

END